﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Bdcs.Core.Entity
{
    /// <summary>
    /// OperateHistory数据模型对象
    /// </summary>
    [Serializable]
    public partial class OperateHistoryMod
    {
        /// <summary>
        /// 初始化OperateHistory数据模型对象
        /// </summary>
        public OperateHistoryMod()
        {
            
        }
        /// <summary>
        /// 初始化OperateHistory数据模型对象并给所有字段赋值
        /// </summary>
        /// <param name="pk">pk</param>
        /// <param name="openid">openid</param>
        /// <param name="opdesc">opdesc</param>
        /// <param name="opkey">opkey</param>
        public OperateHistoryMod(long pk,string openid,string opdesc,string opkey)
        {
            //给pk字段赋值
            this.Pk = pk;
            //给openid字段赋值
            this.Openid = openid;
            //给opdesc字段赋值
            this.Opdesc = opdesc;
            //给opkey字段赋值
            this.Opkey = opkey;
        }
        
		//属性存储数据的变量
        private long _pk;
        private string _openid;
        private string _opdesc;
        private string _opkey;
        
        /// <summary>
        /// pk
        /// </summary>
        public long Pk
        {
            get { return this._pk; }
            set { this._pk = value; }
        }
        /// <summary>
        /// openid
        /// </summary>
        public string Openid
        {
            get { return this._openid; }
            set { this._openid = value; }
        }
        /// <summary>
        /// opdesc
        /// </summary>
        public string Opdesc
        {
            get { return this._opdesc; }
            set { this._opdesc = value; }
        }
        /// <summary>
        /// opkey
        /// </summary>
        public string Opkey
        {
            get { return this._opkey; }
            set { this._opkey = value; }
        }
        
        /// <summary>
        /// 对比两个OperateHistory数据模型对象是否一致
        /// </summary>
        /// <param name="obj">要进行比对的OperateHistory数据模型对象</param>
        /// <returns>返回是否一致，为true一致，为false不一致</returns>
        public override bool Equals(object obj)
        {
            //判断传入对象是否为null
            if (obj == null) return false;
            //将传入对象转换成OperateHistory数据模型对象
            OperateHistoryMod operateHistoryMod = obj as OperateHistoryMod;
            //判断是否转换成功
            if (operateHistoryMod == null) return false;
            //进行匹配属性的值
            return
                //判断pk是否一致
                this.Pk == operateHistoryMod.Pk &&
                //判断openid是否一致
                this.Openid == operateHistoryMod.Openid &&
                //判断opdesc是否一致
                this.Opdesc == operateHistoryMod.Opdesc &&
                //判断opkey是否一致
                this.Opkey == operateHistoryMod.Opkey;
        }
        /// <summary>
        /// 将当前OperateHistory数据模型对象转换成哈希码
        /// </summary>
        /// <returns>哈希值</returns>
        public override int GetHashCode()
        {
            //将OperateHistory数据模型对象的属性进行按位异或运算处理得到哈希码并返回
            return
                //将pk进行按位异或运算处理
                this.Pk.GetHashCode() ^
                //将openid进行按位异或运算处理
                (this.Openid == null ? 2147483647 : this.Openid.GetHashCode()) ^
                //将opdesc进行按位异或运算处理
                (this.Opdesc == null ? 2147483647 : this.Opdesc.GetHashCode()) ^
                //将opkey进行按位异或运算处理
                (this.Opkey == null ? 2147483647 : this.Opkey.GetHashCode());
        }
        /// <summary>
        /// 将当前OperateHistory数据模型对象转换成字符串副本【仅显示在SQL中不能为空的列】
        /// </summary>
        /// <returns>字符串形式副本</returns>
        public override string ToString()
        {
            //将当前OperateHistory数据模型对象转换成字符串副本
            return
                "[" +
                //将pk转换成字符串
                this.Pk + "," +
                //将openid转换成字符串
                this.Openid + "," +
                //将opdesc转换成字符串
                this.Opdesc + "," +
                //将opkey转换成字符串
                this.Opkey +
                "]";
        }
    }
}
